#include <iostream>
#include "Thread.hpp"
#include <memory>

void *thread_run(void *args)
{
    std::string work = static_cast<const char*>(args);
    while (true)
    {
        std::cout << "我是一个新线程，我正在做：" << work << std::endl;
        sleep(1);
    }
}

int main()
{
    std::unique_ptr<Thread> thread1(new Thread(thread_run, (void *)"hello thread1", 1));
    std::unique_ptr<Thread> thread2(new Thread(thread_run, (void *)"hello thread2", 2));
    std::unique_ptr<Thread> thread3(new Thread(thread_run, (void *)"hello thread3", 3));

    thread1->start();
    thread2->start();
    thread3->start();

    thread1->join();
    thread2->join();
    thread3->join();
    return 0;
}